Conversation
There was a problem hiding this comment.
Docker Compose Setup for Project OSRM
This directory contains a Docker Compose configuration to simplify running [Project OSRM](https://github.com/Project-OSRM/osrm-backend).
With this way:
- Only use docker compose up -d
- It launches a frontend service with health checks.
- Don't need to ensure services start in the correct order.
📂 Directory Structure
osrm-backend/
├── docker-compose.yml
├── prepare_osrm.sh
Quick Start
Clone this repository
git clone https://github.com/elshan2000/osrm-backend.git
cd osrm-backendHow It Works
Init Service
-
Checks for the marker file
osrm_is_created. -
If not present, runs:
osrm-extractosrm-partitionosrm-customize
-
Creates the marker file.
-
Exits after preparation.
Backend Service
- Depends on the frontend healthcheck.
- Starts
osrm-routedserving prepared data.
Frontend Service
- Periodically checks for the presence of the marker file
osrm_is_created. - Reports
healthywhen the preparation is complete. - This readiness allows the backend service to start safely.
Health Check Logic
The frontend container performs a health check by verifying:
/data/osrm_is_created
Once the file exists, the health check reports healthy. This ensures that:
✅ Data preparation is complete before routing starts.
Clean Up
To stop and remove all containers:
docker compose downTo force re-preparation of the data (for example, if you want to regenerate .osrm files):
docker compose down
rm ./data/osrm_is_created
docker compose up -dContribution
This Docker Compose configuration was contributed by [elshan2000](https://github.com/elshan2000).
Feel free to open issues or submit improvements!
License
This project follows the [Project OSRM](https://github.com/Project-OSRM/osrm-backend) license (BSD-2-Clause).
DennisOSRM
left a comment
There was a problem hiding this comment.
I wonder if README2 ist the right name for the file. The content seems good, tho.
i can move this readme to docker_compose directory |
|
Thanks for you contribution. Compose files are super application specific though - it doesn't really make sense here to ship one IMHO. Honestly an AI agent will do a better job generating it because it will be a compose file for your specific setup not a random configuration. I'm closing this I don't think this makes a lot of sense upstream. |
Issue
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
Please read our documentation on release and version management.
If your PR is still work in progress please attach the relevant label.
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?